import request from '@/api/request.js'

// 表格数据
export const getTemplateList = (params) => {
    return request({
        url: '/resource/v_list',
        method: 'GET',
        params
    })
}
// 树数据
export const getTemplateTreeList = () => {
    return request({
        url: '/resource/v_tree?root=source',
        method: 'GET'
    })
}

// 新建目录
export const crateDir = (params) => {
    return request({
        url: '/resource/o_create_dir',
        method: 'GET',
        params
    })
}
// 删除单个数据
export const delDirSingle = (params) => {
    return request({
        url: '/resource/o_delete_single',
        method: 'GET',
        params
    })
}

// 删除多个数据
export const delDirMultiple = (params) => {
    return request({
        url: '/resource/o_delete',
        method: 'GET',
        params
    })
}

// 重命名
export const reName = (params) => {
    return request({
        url: '/resource/o_rename',
        method: 'post',
        params
    })
}

// 创建模板
export const createModel = (data) => {
    return request({
        url: '/resource/o_save',
        method: 'POST',
        data
    })
}

// 点击修改获取当前条的信息
export const editModel = (params) => {
    return request({
        url: '/resource/v_edit',
        method: 'GET',
        params
    })
}

// 修改html文件
export const updateModel = (data) => {
    return request({
        url: '/resource/o_ajaxUpdate',
        method: 'POST',
        data
    })
}
